// 2001 Recoding

global keepers2001 ""

numlabel, add

genl id=buniqidr
global keepers2001 $keepers2001 id

genl year=2001
global keepers2001 $keepers2001 year

genl wt=regoctwt
global keepers2001 $keepers2001 wt

genl income=incomes
genl income3=income
centile income, c(33 66 100)
replace income3=0 if income<=r(c_1)
centile income, c(33 66 100)
replace income3=1 if income>r(c_1) & income<=r(c_2)
centile income, c(33 66 100)
replace income3=2 if income>r(c_2) & income<=r(c_3)
global keepers2001 $keepers2001 income3

genl pid_ce=bq2a
recode pid_ce 2/8=0
global keepers2001 $keepers2001 pid_ce

genl turnout=bq8a
recode turnout 2=0
global keepers2001 $keepers2001 turnout

genl vote_ce=bq8b
recode vote_ce 2=1 1 3/7=0
replace vote_ce=0 if vote_ce==. & turnout==1
global keepers2001 $keepers2001 vote_ce


// Campaign Interest

codebook bq3
gen intcampnew = bq3
recode intcampnew 98=2.5 99=. 
replace intcampnew=(abs(intcampnew-4))/3
tab intcampnew bq3
label variable intcampnew "campaing interest new"
label define campinterest 1 "1=high interest"
label values intcampnew campinterest
tab bq3 intcampnew
global keepers2001 $keepers2001 intcampnew

codebook bq57
gen attnpolsnew = bq57
recode attnpolsnew 98=5 99=.
replace attnpolsnew = attnpolsnew/10
tab attnpolsnew bq57
label variable attnpolsnew "attention to politics new"
label values attnpolsnew campinterest
tab bq57 attnpolsnew
global keepers2001 $keepers2001 attnpolsnew

codebook bq1
gen intpolsnew = bq1
recode intpolsnew 9=.
replace intpolsnew=(abs(intpolsnew-5))/4
label variable intpolsnew "interest in pols"
label define interest 1 "1=high interest"
label values intpolsnew interest
tab bq1 intpolsnew
global keepers2001 $keepers2001 intpolsnew

gen ptymembnew = bq46a
recode ptymembnew 1=1 2=0
label variable ptymembnew "party membership new"
label define membr 1 "1=member"
label values ptymembnew membr
tab ptymembnew bq46a
global keepers2001 $keepers2001 ptymembnew


// Media Exposure

// TH: aq33 does not appear to exist in this data set.  Switching to bq59a
*codebook aq33
*gen npexpnew = aq33
codebook bq59a
gen npexpnew = bq59a
recode npexpnew 1=1 2=0 99=.
label variable npexpnew "reads newspaper new"
label define reads 1 "1=reads np"
label values npexpnew reads
*tab aq33 npexpnew
tab bq59a npexpnew
global keepers2001 $keepers2001 npexpnew

codebook bq64
gen tvfollownew = bq64
replace tvfollownew = (abs(tvfollownew-4))/3
label variable tvfollownew "followed campaign on tv new"
label define foll 1 "1=followed"
label values tvfollownew foll
tab bq64 tvfollownew
global keepers2001 $keepers2001 tvfollownew


// Ideology

codebook bq39a
gen taxspendnew = bq39a
recode taxspendnew  98=5 99=. 
replace taxspendnew=taxspendnew/10
label variable taxspendnew "social spending new"
label define spend 1 "1=pro-spending" 
label values taxspendnew spend
tab taxspendnew
tab bq39a
global keepers2001 $keepers2001 taxspendnew



gen leftrightselfnew = bq38f
gen flip = leftrightselfnew -10
replace flip = (abs(flip))/10
replace leftrightselfnew = flip
drop flip
tab leftrightselfnew bq38f
label variable leftrightselfnew "left-right self placement new"
label define lr 1 "1=left"
label values leftrightselfnew lr
tab leftrightselfnew bq38f
global keepers2001 $keepers2001 leftrightselfnew



// Class/occupation

// Assuming that husband is "head of household"
*gen class_head_grade = 
*recode class_head_grade 0=.
label define LblClassGoldHeath 1 "High grade prof./man." 2 "Low grade prof./man." 3 "Routine office" 4 "Sales & personal" 5 "Small petty bourg. w emps" 6 "Small petty bourg. wo emps" 7 "Farmers" 8 "Manual foremen" 9 "Skilled manual" 10 "Semi & unskilled manual" 11 "Agric. employees"
*label values class_head_grade LblClassGrade
*global keepers2001 $keepers2001 class_head_grade

gen class_resp_goldheath = gld11r
recode class_resp_goldheath -8=. -2=.
label values class_resp_goldheath LblClassGoldHeath
global keepers2001 $keepers2001 class_resp_goldheath

gen class_spou_goldheath = gld11s
recode class_spou_goldheath -8=. -2=.
label values class_spou_goldheath LblClassGoldHeath
global keepers2001 $keepers2001 class_spou_goldheath

gen male = bq104
recode male 1=1 2=0 9=. 99=.
global keepers2001 $keepers2001 male

gen married = bq73
recode married 1=1 2=1 3=0 4=0 5=0 6=0 99=0
global keepers2001 $keepers2001 married


gen unionmem_resp = trades
recode unionmem_resp 1=1 2=0 3=0 8=. 9=.
global keepers2001 $keepers2001 unionmem_resp

gen unionmempast_resp = trades
recode unionmempast_resp 1=0 2=1 3=0 8=. 9=.
global keepers2001 $keepers2001 unionmempast_resp



// Economic perceptions

gen econ_ego_retro = bq26
recode econ_ego_retro 1/2=0 3=1 4/5=2 8 9 99=.
global keepers2001 $keepers2001 econ_ego_retro
